//
//  CouponCommentListHV.m
//  penzer
//
//  Created by 还带大道 on 2018/11/10.
//  Copyright © 2018年 caiyc. All rights reserved.
//

#import "CouponCommentListHV.h"

@interface CouponCommentListHV()
@property (weak, nonatomic) IBOutlet UILabel *totalCount;
@property (weak, nonatomic) IBOutlet UIImageView *star1;
@property (weak, nonatomic) IBOutlet UIImageView *start2;
@property (weak, nonatomic) IBOutlet UIImageView *start3;
@property (weak, nonatomic) IBOutlet UIImageView *start4;
@property (weak, nonatomic) IBOutlet UIImageView *start5;
@property (weak, nonatomic) IBOutlet UILabel *scroe;
@property (weak, nonatomic) IBOutlet UIButton *allBtn;
@property (weak, nonatomic) IBOutlet UIButton *goodBtn;
@property (weak, nonatomic) IBOutlet UIButton *middleBtn;
@property (weak, nonatomic) IBOutlet UIButton *badBtn;
@property (nonatomic,strong) UIButton *last_btn;
@end

@implementation CouponCommentListHV

+ (instancetype)shareView
{
    return [[NSBundle mainBundle] loadNibNamed:NSStringFromClass([self class]) owner:nil options:nil].lastObject;
}

- (void)awakeFromNib
{
    [super awakeFromNib];
    _allBtn.tag = 0;
    _goodBtn.tag = 1;
    _middleBtn.tag = 2;
    _badBtn.tag = 3;
    _allBtn.layer.cornerRadius = 1;
    _goodBtn.layer.cornerRadius = 1;
    _middleBtn.layer.cornerRadius = 1;
    _badBtn.layer.cornerRadius = 1;
    [self btnOnClick:_allBtn];
}



- (IBAction)btnOnClick:(UIButton *)btn {
    if(btn == _last_btn) return;
    [_last_btn setTitleColor:RZ_COLOR(155, 155, 155) forState:UIControlStateNormal];
    _last_btn.backgroundColor = RZ_COLOR(219, 219, 219);
    
    [btn setTitleColor:RZ_COLOR(74, 74, 74) forState:UIControlStateNormal];
    btn.backgroundColor = RZ_COLOR(254, 220, 69);
    
    _last_btn = btn;
    !self.itemOnClickBlock?:self.itemOnClickBlock(btn.tag);
    
}

@end
